<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <title>功能菜单</title>
    <link rel="stylesheet" href="../../css/api.css" />
    <link rel="stylesheet" href="../../css/common.css" />
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_865299_nkef3z86ya9.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_863309_xe2mpg4u0x.css">
</head>

<body>
    <section class="has-header">
        <div class="yt-list">
            <div class="yt-item isLink" onclick="goPage('scanner')">
                <span class="yt-item-content">二维码扫描</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
            <div class="yt-item isLink" onclick="goPage('openFile')">
                <span class="yt-item-content">打开文件</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
            <div class="yt-item isLink" onclick="goPage('playVideo')">
                <span class="yt-item-content">视频播放</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
            <div class="yt-item isLink" onclick="goPage('photoBrowser')">
                <span class="yt-item-content">预览图片</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
            <div class="yt-item isLink" onclick="goPage('pdfReader')">
                <span class="yt-item-content">打印pdf</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
            <div class="yt-item isLink" onclick="goPage('takePhoto')">
                <span class="yt-item-content">拍照</span>
                <i class="yt-item-link yt-icon yt-icon-right"></i>
            </div>
        </div>
    </section>
</body>
<script src="./script/api.js"></script>
<script>
    var pages = [
      {
        name: 'scanner',
        url: '../scanner/index.html'
      },
      {
        name: 'openFile',
        url: '../openFile/index.html'
      },
      {
        name: 'playVideo',
        url: '../playVideo/index.html'
      },
      {
        name: 'photoBrowser',
        url: '../photoBrowser/index.html'
      },
      {
        name: 'pdfReader',
        url: '../pdfReader/index.html'
      },
      {
        name: 'takePhoto',
        url: '../takePhoto/index.html'
      }
    ]
    apiready = function() {
        loadData()
    }

    function loadData() {

    }

    function goPage(name) {
      var targetPage = null
      for (var i=0; i<pages.length; i++) {
        if (pages[i].name === name) {
          targetPage = pages[i]
          break
        }
      }
      api.openWin(targetPage)
    }
</script>

</html>
